﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication
{
    public class ArrayClass
    {
        public void Call()
        {
            PassValue();
            CreateCustomArray();
        }
        private void Definition()
        {
            double[,] myDoubles = new double[10, 20];
        }
        private void PassValue()
        {
            int i = 100;
            Console.WriteLine("Before called chanaged:i=" + i.ToString());
            ChangeValue(i);
            Console.WriteLine("After called chanaged:i=" + i.ToString());
            string s = "I'm begin value!";
            Console.WriteLine("Before called chanaged:s=" + s);
            ChangeValue(s);
            Console.WriteLine("After called chanaged:s=" + s);
            List<int> list = new List<int>();
            for (int j = 0; j < 10; j++)
            {
                list.Add(j);
            }
            Console.WriteLine("Before called chanaged:list.Count=" + list.Count.ToString());
            ChangeValue(list);
            Console.WriteLine("After called chanaged:list.Count=" + list.Count.ToString());
        }
        private void ChangeValue(int i)
        {
            i = 1000;
        }
        private void ChangeValue(string s)
        {
            s = "I chanaged you!older you are " + s;
        }
        private void ChangeValue(List<int> list)
        {
            for (int i = 0; i < 1000; i++)
            {
                list.Add(i);
            }
        }
        private void CreateCustomArray()
        {
            int[] lowerBounds = { 2005};
            int[] lengths = { 5};
            Array customArray = Array.CreateInstance(typeof(int), lengths, lowerBounds);
            customArray.SetValue(100, 2005);
        }
    }
}
